import { Col, Icon, Input, Row, Tooltip } from 'antd';
import React from 'react';
import styles from '../styles.less';

function Regex({ value, onChange }) {
  const { pattern } = value;

  return (
    <Row style={{ width: '100%' }}>
      <Col style={{ display: 'flex', alignItems: 'center' }}>
        <div className={styles.label}>正则表达式</div>
        <div className={styles.item} style={{ flexGrow: 1 }}>
          <Input
            value={pattern}
            onChange={e => onChange({ pattern: e.target.value })}
            placeholder="^\w+\d$"
            style={{ width: 300 }}
          />
        </div>
      </Col>
    </Row>
  );
}

export default Regex;
